#!/bin/bash
goal=`date +%s -d 20181001`

while true 或者until false
do
        	now=`date +%s`
	if [ $[$goal-$now] -eq 0 ];then
		break
	fi
        day=$[($goal-$now)/86400]
        hour=$[($goal-$now)%86400/3600]
        minute=$[($goal-$now)%3600/60]
        second=$[($goal-$now)%60]
	clear
        echo "离2018年1月1日还有$day天:$hour时:$minute分:$second秒"
        sleep 1
done
echo "元旦节快乐!!!"